home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12530 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  57 lines

  1. Path: nntp.atlanta.com!not-for-mail
  2. From: curts@compgen.com (Curt Smith)
  3. Newsgroups: comp.lang.c++,comp.unix.unixware.misc
  4. Subject: Re: Getting proper symbol names using G++ (unixware)
  5. Followup-To: comp.lang.c++,comp.unix.unixware.misc
  6. Date: 20 Mar 1996 12:55:04 GMT
  7. Organization: Internet Atlanta
  8. Message-ID: <4iov78$99@nntp.atlanta.com>
  9. References: <827178990.20294@dekard.demon.co.uk>
  10. NNTP-Posting-Host: gw1.compgen.com
  11. CC: mat@dekard.demon.co.uk
  12. X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]
  13.  
  14. Matt Mower (mat@dekard.demon.co.uk) wrote:
  15. : Using g++ v2.7.2 on my UnixWare system the list of undefined symbols
  16. : is very nearly unreadable. Instead of saying
  17. :     SomeClass::AMemberFunction undefined in module .....
  18. : I get what I suppose is the mangled function name, and that's a bit
  19. : harder to follow.
  20. : Can anyone suggest where I may have gone wrong with g++, and how I
  21. : might get it to give me unmangled names.
  22.  
  23. In your .c and .h files bound the inclusion of system headers with:
  24.  
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.    
  30. #include <stdio.h>
  31.  
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35.  
  36.  
  37. In your function prototype headers you bound the prototype with:
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.    
  43. foo ( int a );
  44.  
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48.  
  49. -- 
  50.  
  51. Curt Smith
  52. curts@compgen.com
  53.  
  54.